﻿<%@ Page Language="C#" AutoEventWireup="true"  EnableEventValidation = "false" CodeFile="ClassEmp3Detail.aspx.cs" Inherits="Manage_Emp3_ClassEmp3Detail" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
     <script type="text/javascript">
         function checkForm() {
             var title = document.getElementById("txttitle");
             var classid = document.getElementById("hdfClassId");
             if (title.value.length == 0) {
                 alert("请填写标题！");
                 title.focus();
                 return false;
             }
             if (classid.value == "0") {
                 alert("请选择一个课程！");
                 return false;
             }
         }
         function checkPeriod() {
             var period = document.getElementById("txtPeriod");
             var reg = /^([2-9]\d{3})(0[1-9]|1[0-2])$/;
             if (period.value.length == 0) {
                 alert("计划安排时间不能为空！")
                 period.focus();
                 return false;
             }
             if (!reg.test(period.value)) {
                 alert("计划安排时间格式不正确,正确的格式形如：201206！")
                 period.focus();
                 return false;
             }
         }
         function CheckSearchFilter() {
             var center = document.getElementById("ddlcenter");
             var city = document.getElementById("ddlcity");
             if (center.value == "0") {
                 alert("请选择一个指挥中心！");
                 return false;
             }
             if (city.value == "0") {
                 alert("请选择一个城市！");
                 return false;
             }
         }
  </script>
    <link rel="stylesheet" type="text/css" href="../skin/css/base.css" />
    <style type="text/css">
        .style1
        {
            width: 130px;
        }
        .style2
        {
            width: 242px;
        }
        .style3
        {
            width: 47px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server"  EnableScriptGlobalization="True" EnableScriptLocalization="True">
        </asp:ScriptManager>
         <asp:UpdatePanel ID="up1" runat="server" >
    <ContentTemplate>
     <table width="98%" border="0" cellpadding="0" cellspacing="1" bgcolor="#D1DDAA" align="center" >
        <tr>
            <td height="26" background="../skin/images/newlinebg3.gif">
                <table width="98%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td align="center"><span style="font-size:14px; font-weight:bold">上课学员名单详细信息</span></td>
                        <td  align="right"  style="width:60px">
                        <asp:Button ID="btnreturn" class="coolbg_add" runat="server" Text="返回列表" 
                                onclick="btnreturn_Click"/>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
      <table width="98%" border="0" cellpadding="2" cellspacing="1" bgcolor="#D1DDAA" align="center" style="margin-top:8px">
        <tr bgcolor="#E7E7E7">
          <td height="24" colspan="6" background="../skin/images/tbg.gif"><div align="left" >
              上课课程信息</div></td>
        </tr>
       <tr align='center' bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22" >
           <td align="left" >编号：</td>
           <td align="left"  colspan="2">
              <asp:Label ID="lblNum" runat="server" ></asp:Label>
             </td>
             <td align="left" class="style1">标题：</td>
             <td align="left"  colspan="2">
                 <asp:TextBox ID="txttitle"  runat="server" 
                     Width="347px"></asp:TextBox></td>
        </tr>
        <tr align='center' bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22" >
            <td align="left" >课程类型：</td>
            <td align="left" width="140px">
              <asp:DropDownList ID="ddlclassType" runat="server" Width="130px" 
                    AutoPostBack="True" onselectedindexchanged="ddlclassType_SelectedIndexChanged" ></asp:DropDownList>
             </td>
             <td align="left" width="140px"><asp:DropDownList ID="ddlClass" runat="server" 
                     Width="130px" AutoPostBack="True" 
                     onselectedindexchanged="ddlClass_SelectedIndexChanged"></asp:DropDownList></td>
             <td align="left" class="style1">课程编号或名称：</td>
             <td align="left" colspan="2" ><asp:TextBox ID="txtkeyword" runat="server"></asp:TextBox>
                 <asp:ImageButton ID="ibtnsearch" runat="server" BorderStyle="None" 
                     CssClass="np" Height="20px" ImageUrl="../skin/images/frame/search.gif" 
                     onclick="ibtnsearch_Click" Width="45px" />
            </td>
             
        </tr>
        <tr align='center' bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22" >
            <td align="left" >课程编号：</td>
            <td  align="left" colspan="2">
                <asp:Label ID="lblClassCode" runat="server"></asp:Label>
             </td>
             <td align="left" class="style1" >课程名称：</td>
            <td align="left" colspan="2">
                <asp:Label ID="lblclassName" runat="server"></asp:Label>
                <asp:HiddenField ID="hdfClassId" runat="server"  Value="0"/>
                <asp:HiddenField ID="hdfClassEmpId" runat="server" Value="0" />
            </td>
        </tr>
       
      </table>
       <!--  提交 -->
      <table width='98%'  border='0' cellpadding='1' cellspacing='1' bgcolor='#CBD8AC' align="center" style="margin-top:8px">
        <tr bgcolor='#EEF4EA'>
          <td background='skin/images/wbg.gif' align='center'><table border='0' cellpadding='0' cellspacing='0' align='center'>
              <tr>
                
                <td ><asp:Button ID="btnsave" runat="server" Text="保存" 
                        OnClientClick="return checkForm();false" onclick="btnsave_Click" /></td>
               
              </tr>
            </table></td>
        </tr>
      </table>
     <table width="98%" border="0" cellpadding="2" cellspacing="1"  align="center" style="margin-top:8px">
   
    <tr  style="border-bottom:none">
	    <td height="24" style=" text-align:right"> 
            <asp:Button ID="btnAddEmp" runat="server" Text="添加上课学员" 
                onclick="btnAddEmp_Click" />
        </td>
    </tr>
    </table>
     <table width="98%" border="0" cellpadding="2" cellspacing="1" bgcolor="#D1DDAA" align="center" style="margin-top:8px">
   
    <tr bgcolor="#E7E7E7" style="border-bottom:none">
	    <td height="24"  background="../skin/images/tbg.gif">&nbsp;计划上课学员名单列表&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:Button ID="btnexport" runat="server" Text="导出选中行到Excel" onclick="btnexport_Click" />&nbsp;
        &nbsp;&nbsp; <asp:CheckBox ID="ckbIsHidFinishRecod" runat="server" 
                AutoPostBack="true" oncheckedchanged="ckbIsHidFinishRecod_CheckedChanged" Text="隐藏已完成的记录" />
    </tr>
    
    <tr style="background-color:#ffffff">
    <td >
          <asp:GridView ID="GridView1" runat="server" Width="100%" CellPadding="4" BorderColor="#D1DDAA"  
                            AutoGenerateColumns="False" OnRowCancelingEdit="GridView1_RowCancelingEdit"
                            OnRowEditing="GridView1_RowEditing" 
              OnRowUpdating="GridView1_RowUpdating" OnRowDeleting="GridView1_RowDeleting"
                            DataKeyNames="PlanFinishId"  DataMember="Name" SelectedIndex="0" 
              OnRowDataBound="GridView1_RowDataBound" GridLines="Both" 
              AllowPaging="False" PageIndex="1" AllowSorting="true" 
              onsorting="GridView1_Sorting" onrowcommand="GridView1_RowCommand"  >
                            <Columns>
                                <asp:TemplateField HeaderText="选择" >
                                    <ItemTemplate>
                                          <asp:CheckBox ID="chkID1" runat="server" />
                                          <asp:HiddenField ID="hdfPlanFinishId" runat="server" Value='<%#Eval("PlanFinishId") %>' />
                                    </ItemTemplate>
                                    
                                    <ItemStyle width="40px" HorizontalAlign="Center"  />
                                </asp:TemplateField>
                                 <asp:TemplateField HeaderText="所属指挥中心" SortExpression="CenterName">
                                    <ItemTemplate>
                                        <asp:Label ID="lblCenterName" runat="server" Text='<%# Eval("CenterName") %>'></asp:Label>
                                    </ItemTemplate>
                                  
                                </asp:TemplateField>
                                  <asp:TemplateField HeaderText="城市" SortExpression="CityName">
                                    <ItemTemplate>
                                        <asp:Label ID="lblCityName" runat="server" Text='<%# Eval("CityName") %>'></asp:Label>
                                     </ItemTemplate> 
                                </asp:TemplateField>
                               
                                <asp:TemplateField HeaderText="部门" SortExpression="DeptName">
                                    <ItemTemplate>
                                        <asp:Label ID="lblDeptName" runat="server" Text='<%# Eval("DeptName") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="所在店铺代码" SortExpression="StoreCode">
                                    <ItemTemplate>
                                        <asp:Label ID="lblStoreCode" runat="server" Text='<%# Eval("StoreCode") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="姓名" SortExpression="Name">
                                    <ItemTemplate>
                                        <asp:Label ID="lblName" runat="server" Text='<%# Eval("Name") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                 <asp:TemplateField HeaderText="员工号" SortExpression="Code">
                                    <ItemTemplate>
                                        <asp:Label ID="lblCode" runat="server" Text='<%# Eval("Code") %>'></asp:Label>
                                      
                                    </ItemTemplate>
                                </asp:TemplateField>
                                 <asp:TemplateField HeaderText="职位" SortExpression="JobName">
                                    <ItemTemplate>
                                        <asp:Label ID="lblJobName" runat="server" Text='<%# Eval("JobName") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
								<asp:TemplateField HeaderText="所属品牌" SortExpression="BrandName">
                                    <ItemTemplate>
                                        <asp:Label ID="lblBrandName" runat="server" Text='<%# Eval("BrandName") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
								<asp:TemplateField HeaderText="入职时间" SortExpression="EntryDate">
                                    <ItemTemplate>
                                        <asp:Label ID="lblEntryDate" runat="server" Text='<%#Eval("EntryDate")%>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
								 <asp:TemplateField HeaderText="计划安排时间" SortExpression="Period">
                                    <ItemTemplate>
                                        <asp:Label ID="lblPeriod" runat="server" Text='<%#Eval("Period")%>'></asp:Label>
                                        <asp:HiddenField ID="hdfEmpId1" runat="server" Value='<%#Eval("EmpId") %>' />
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:TextBox ID="txtPeriod" runat="server" Text='<%#Eval("Period")%>'></asp:TextBox>
                                        <asp:HiddenField ID="hdfEmpId" runat="server" Value='<%#Eval("EmpId") %>' />
                                        <asp:HiddenField ID="hdfIsFininsh" runat="server" Value='<%#Eval("FinishId")%>' />
                                    </EditItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="是否完成" SortExpression="IsFinish">
                                    <ItemTemplate>
                                        <asp:Label ID="lblIsFininsh" runat="server" Text='<%#Eval("Finish")%>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="完成操作"   >
                                    <ItemTemplate>
                                        <asp:HiddenField ID="hdfEmpId2" runat="server" Value='<%#Eval("EmpId") %>' />
                                        <asp:HiddenField ID="hdfIsFininsh1" runat="server" Value='<%#Eval("FinishId")%>' />
                                        <asp:Button ID="btnfinish" runat="server" Text="完成" CommandName="finish"  CommandArgument='<%#Eval("PlanFinishId") %>'></asp:Button>
                                    </ItemTemplate>
                                     <ItemStyle width="80px" HorizontalAlign="Center"  />
                                </asp:TemplateField>
                                <asp:CommandField   HeaderText="操作" ItemStyle-HorizontalAlign="Center" />
                                
                            </Columns>
                             <PagerSettings FirstPageText="" LastPageText="" NextPageText="" PreviousPageText="" />
                            <RowStyle Height="20px" BackColor="#FFFFFF"  ForeColor="#000000" />
                            <FooterStyle BackColor="#FFFFFF" Font-Bold="True" ForeColor="White" />
                            <EditRowStyle BackColor="#FCFDEE" />
                            <SelectedRowStyle BackColor="#FFFFFF"  ForeColor="#000000" />
                            <PagerStyle BackColor="#FCFDEE" ForeColor="White" HorizontalAlign="Center" />
                            <HeaderStyle BackColor="#FCFDEE"  ForeColor="000000" />
                            <AlternatingRowStyle BackColor="#FCFDEE" ForeColor="#000000" />
                                            </asp:GridView>
      </td>
   </tr>
     <tr bgcolor="#FAFAF1">
    <td height="28"  style=" padding-left:14px">
	    <asp:CheckBox ID="selectAll1" runat="server" Enabled="false"  Text="全选" 
            oncheckedchanged="selectAll1_CheckedChanged" AutoPostBack="true" />&nbsp;
          <asp:Button class="coolbg" ID="Button1" Enabled="false" OnClientClick="return confirm('你确定要删除选择课程吗?');" runat="server"
                          Text="批量删除"  OnClick="btnDeleteMass_Click"/>
    </td>
    </tr>
    </table>
    <div id="divadd_emp" runat="server" visible="false">
    <table width="98%" border="0" cellpadding="2" cellspacing="1"  align="center" style="margin-top:8px">
   
    <tr  style="border-bottom:none">
	    <td height="24" style=" text-align:left"> 
           <asp:Label ID="lbladdclass" runat="server" ForeColor="Red" Text="添加上课学员"></asp:Label>
        </td>
    </tr>
    </table>
       <table width="98%" border="0" cellpadding="2" cellspacing="1" bgcolor="#D1DDAA" align="center" style="margin-top:8px">
    <tr bgcolor="#E7E7E7" style="border-bottom:none">
	    <td align="left" colspan="6" background="../skin/images/tbg.gif">
            <table align="center" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td width="200px">
                        未上此课程学员名单列表</td>
                    <td width="90px">
                        所属指挥中心：</td>
                    <td width="110px">
                        <asp:DropDownList ID="ddlcenter" runat="server" Width="100px" 
                            AutoPostBack="True" onselectedindexchanged="ddlcenter_SelectedIndexChanged">
                        </asp:DropDownList>
                    </td>
                    <td width="50px">
                        城市：</td>
                    <td width="110px">
                        <asp:DropDownList ID="ddlcity" runat="server" Width="100px">
                        </asp:DropDownList>
                    </td>
                     <td width="50px">
                        职位：</td>
                    <td width="110px">
                        <asp:DropDownList ID="ddljob" runat="server" Width="100px">
                        </asp:DropDownList>
                    </td>
                    <td width="100">
                        员工编号或姓名： 
                    </td>
                    <td width="165">
                        <asp:TextBox ID="txtkey" runat="server" Width="150px"></asp:TextBox>
                    </td>
                   
                    <td width="100px">
                        <asp:ImageButton ID="ImageButton1" runat="server" BorderStyle="None" 
                            Height="20px" ImageUrl="../skin/images/frame/search.gif" 
                             Width="45px" onclick="ImageButton1_Click" OnClientClick="return CheckSearchFilter();false" />
                    </td>
                     
                </tr>
            </table>
        </td>
           <tr style="background-color:#ffffff">
               <td colspan="6">
                   <asp:GridView ID="GridView2" runat="server" AllowPaging="False" 
                       AllowSorting="true" AutoGenerateColumns="False" BorderColor="#D1DDAA" 
                       CellPadding="4" DataKeyNames="EmpId" DataMember="Name" GridLines="Both" 
                       OnRowDataBound="GridView2_RowDataBound" onsorting="GridView2_Sorting" 
                       PageIndex="1" SelectedIndex="0" Width="100%">
                       <Columns>
                           <asp:TemplateField HeaderText="选择">
                               <ItemTemplate>
                                   <asp:CheckBox ID="chkID" runat="server" />
                                   <asp:HiddenField ID="hdfEmpId" runat="server" Value='<%#Eval("EmpId") %>' />
                               </ItemTemplate>
                               <ItemStyle HorizontalAlign="Center" width="40px" />
                           </asp:TemplateField>
                             <asp:TemplateField HeaderText="所属指挥中心" SortExpression="CenterName">
                                    <ItemTemplate>
                                        <asp:Label ID="lblCenterName" runat="server" Text='<%# Eval("CenterName") %>'></asp:Label>
                                    </ItemTemplate>
                                  
                                </asp:TemplateField>
                                  <asp:TemplateField HeaderText="城市" SortExpression="CityName">
                                    <ItemTemplate>
                                        <asp:Label ID="lblCityName" runat="server" Text='<%# Eval("CityName") %>'></asp:Label>
                                     </ItemTemplate> 
                                </asp:TemplateField>
                               
                                <asp:TemplateField HeaderText="部门" SortExpression="DeptName">
                                    <ItemTemplate>
                                        <asp:Label ID="lblDeptName" runat="server" Text='<%# Eval("DeptName") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                 <asp:TemplateField HeaderText="所在店铺代码" SortExpression="StoreCode">
                                    <ItemTemplate>
                                        <asp:Label ID="lblStoreCode" runat="server" Text='<%# Eval("StoreCode") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="姓名" SortExpression="Name">
                                    <ItemTemplate>
                                        <asp:Label ID="lblName" runat="server" Text='<%# Eval("Name") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                 <asp:TemplateField HeaderText="员工号" SortExpression="Code">
                                    <ItemTemplate>
                                        <asp:Label ID="lblCode" runat="server" Text='<%# Eval("Code") %>'></asp:Label>
                                      
                                    </ItemTemplate>
                                </asp:TemplateField>
                                 <asp:TemplateField HeaderText="职位" SortExpression="JobName">
                                    <ItemTemplate>
                                        <asp:Label ID="lblJobName" runat="server" Text='<%# Eval("JobName") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
								<asp:TemplateField HeaderText="所属品牌" SortExpression="BrandName">
                                    <ItemTemplate>
                                        <asp:Label ID="lblBrandName" runat="server" Text='<%# Eval("BrandName") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
								<%--<asp:TemplateField HeaderText="入职时间" SortExpression="EntryDate">
                                    <ItemTemplate>
                                        <asp:Label ID="lblEntryDate" runat="server" Text='<%#Convert.ToDateTime(Eval("EntryDate").ToString()).ToShortDateString().Replace("1900/1/1","") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>--%>
                       </Columns>
                       <PagerSettings FirstPageText="" LastPageText="" NextPageText="" 
                           PreviousPageText="" />
                       <RowStyle BackColor="#FFFFFF" ForeColor="#000000" Height="20px" />
                       <FooterStyle BackColor="#FFFFFF" Font-Bold="True" ForeColor="White" />
                       <EditRowStyle BackColor="#FCFDEE" />
                       <SelectedRowStyle BackColor="#FFFFFF" ForeColor="#000000" />
                       <PagerStyle BackColor="#FCFDEE" ForeColor="White" HorizontalAlign="Center" />
                       <HeaderStyle BackColor="#FCFDEE" ForeColor="000000" />
                       <AlternatingRowStyle BackColor="#FCFDEE" ForeColor="#000000" />
                   </asp:GridView>
               </td>
           </tr>
           <tr bgcolor="#FAFAF1">
               <td height="28" style="padding-left:14px">
                   <asp:CheckBox ID="selectAll" runat="server" AutoPostBack="true" Enabled="false" 
                       oncheckedchanged="selectAll_CheckedChanged" Text="全选" />
               </td>
                 <td  colspan="5">
                        计划安排时间（格式为年月，e.g:201206）： 
                   
                        <asp:TextBox ID="txtPeriod" runat="server" width="150px"></asp:TextBox>
                    
                     
                    <asp:Button ID="btnMassAdd" runat="server" class="coolbg" Enabled="false" 
                       OnClick="btnMassAdd_Click" OnClientClick="return checkPeriod();false;" 
                       Text="批量添加" />
            </td>
           </tr>
           <tr align="right" bgcolor="#EEF4EA">
               <td align="center" height="36" colspan="6">
                   <%--    <webdiyer:AspNetPager ID="pager1" runat="server" OnPageChanged="pager1_PageChanged"
                        PageSize="10">
                    </webdiyer:AspNetPager>--%>
               </td>
           </tr>
    </table>
     </div>
     
    </ContentTemplate>
       <Triggers><asp:PostBackTrigger ControlID="btnexport" /></Triggers>
    </asp:UpdatePanel> 
    </form>
</body>
</html>
